<template>
  <nf-form
    v-form-drag="extendFormProps"
    :model="model"
    :partModel="partModel"
    v-bind="extendFormProps"
  >
  </nf-form>
</template>

<script>
  import { reactive, defineComponent } from 'vue'
  import { nfForm } from '../../map'
  import { getItemState } from '../state-item'
  import myWatch from './controller'

import item_check from '../json/item-checks.json'

const _temp = {
  150: `<el-checkbox
  v-model="checkbox"
  v-bind="itemProps"
/>`,
  151: `<el-switch
  v-model="switch"
  v-bind="itemProps"
/>`,
  152: `<el-checkbox-group
  v-model="checkboxs"
  v-bind="itemProps"
>
  <el-checkbox
    v-for="item in itemProps.optionList"
    :key="'check' + columnId + item.value"
    :label="item.value"
    :disabled="item.disabled"
  >
    {{item.label}}
  </el-checkbox>
</el-checkbox-group>`,
  153: `<el-radio-group
  v-model="radios"
  v-bind="itemProps"
>
  <el-radio
    v-for="item in itemProps.optionList"
    :key="'radio' + columnId + item.value"
    :label="item.value">
      {{item.label}}
  </el-radio>
</el-radio-group>`
  
}
  export default defineComponent({
    name: 'nf-meta-help-item-extend-number',
    inheritAttrs: false,
    components: {
      nfForm
    },
    props: {
      temp: Object // 返回模板
    },
    setup(props) {
      const state = getItemState()
        
      // 文本类扩展属性表单，需要的 meta
      const extendFormProps = reactive(item_check)
      
      const {
        setup,
        model,
        partModel,
      } = myWatch(props)

      setup(model)
      
      
      return {
        state,
        model,
        partModel,
        extendFormProps
      }
    }
  })

</script>